<?php
class WDealCategoryHelper extends USystemWorklet
{
	public function taskCategories()
	{
		$c = new CDbCriteria(array(
			'condition' => 'enabled=?',
			'params' => array(1),
			'order' => 'name ASC',
		));		
		return MDealCategory::model()->findAll($c);
	}
	
	public function taskUserCategory()
	{
		return wm()->get('base.helper')->getFromCookie('category');
	}
	
	public function taskCategory($id)
	{
		return MDealCategory::model()->findByPk($id);
	}
}